<%@ page language="java" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
    <%@include file="/WEB-INF/common/hplus-css.jsp"%>
    <link href="${path}/assets/hplus/css/style.css?v=4.1.0" rel="stylesheet">
</head>
<body class="gray-bg">
    <div class="form-group">
        <div class="col-sm-2">
            <div class="col-xs-9">
                <div class="input-group">
                    <input type="text" class="form-control no-padding"
                        name="demolition" placeholder="作业项目爆破员" id="testNoBtn"/>
                    <div class="input-group-btn">
                        <button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
                            <span class="caret"></span>
                        </button>
                        <ul class="dropdown-menu dropdown-menu-right" role="menu">
                        </ul>
                    </div>
                </div>
            </div>
        </div>
        <div class="col-sm-2">
            <div class="col-xs-9">
                <div class="input-group">
                    <input type="text" placeholder="联系电话"
                        name="demolitionPhone" minlength="2" class="form-control"
                        required="" aria-required="true" id="input2">
                    <div class="input-group-btn">
                        <button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
                            <span class="caret"></span>
                        </button>
                        <ul class="dropdown-menu dropdown-menu-right" role="menu">
                        </ul>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <%@include file="/WEB-INF/common/hplus-suggest-js.jsp"%>
    <!-- 自定义js -->
    <script type="text/javascript">
        $(function(){
        	$("#testNoBtn").bsSuggest({
                url: "${path}/assets/js/plugins/suggest0.1.26/data.json",
                /*effectiveFields: ["userName", "shortAccount"],
                searchFields: [ "shortAccount"],*/
                effectiveFieldsAlias:{userName: "姓名",shortAccount:"账号",userId:"编号"},
                ignorecase: true,
                showHeader: true,
                showBtn: false,     //不显示下拉按钮
                delayUntilKeyup: true, //获取数据的方式为 firstByUrl 时，延迟到有输入/获取到焦点时才请求数据
                idField: "userId",
                keyField: "userName",
                clearable: true
            }).on('onDataRequestSuccess', function (e, result) {
                console.log('onDataRequestSuccess: ', result);
            }).on('onSetSelectValue', function (e, keyword, data) {
                console.log('onSetSelectValue1111: ', keyword, data.userId,data.userName,data.shortAccount);
                //初始化第二个
                $("#input2").bsSuggest({
                    url: "${path}/assets/js/plugins/suggest0.1.26/data.json",
                    /*effectiveFields: ["userName", "shortAccount"],
                    searchFields: [ "shortAccount"],*/
                    effectiveFieldsAlias:{userName: "姓名",shortAccount:"账户"},
                    ignorecase: true,
                    showHeader: true,
                    showBtn: false,     //不显示下拉按钮
                    delayUntilKeyup: true, //获取数据的方式为 firstByUrl 时，延迟到有输入/获取到焦点时才请求数据
                    idField: "userId",
                    keyField: "userName",
                    clearable: true
                }).on('onDataRequestSuccess', function (e, result) {
                    console.log('onDataRequestSuccess: ', result);
                }).on('onSetSelectValue', function (e, keyword, data) {
                    console.log('onSetSelectValue1111: ', keyword, data.userId,data.userName,data.shortAccount);
                    //初始化第二个
                }).on('onUnsetSelectValue', function () {
                    console.log("onUnsetSelectValue");
                });
            }).on('onUnsetSelectValue', function () {
                console.log("onUnsetSelectValue");
            });
        });
    </script>
</body>

</html>
